package com.tedu._04mybatis.mapper;

import com.tedu._04mybatis.pojo.Comment;
import com.tedu._04mybatis.pojo.CommentVO1;
import com.tedu._04mybatis.pojo.CommentVO2;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CommentMapper {
   // @Insert("INSERT INTO comment(content,created,article_id,user_id) VALUES (#{content},#{created},#{articleId},#{userId})")
    int insertComment(Comment comment);

    //@Delete("DELETE FROM comment WHERE id=#{id}")
    int deleteById(Integer id);

    //@Update("UPDATE comment SET content=#{content},created=#{created},article_id=#{articleId},user_id=#{userId} WHERE id=#{id}")
    int updateById(Comment comment);

    //@Select("SELECT content,article_id articleId,user_id userId FROM comment WHERE id= #{id}")
    CommentVO1 selectCommentById1(Integer id);

    //@Select("SELECT content,article_id articleId FROM comment WHERE user_id= #{id}")
    CommentVO2 selectCommentById2(Integer id);

}
